package com.weblog.search.client;

import com.weblog.search.client.impl.UserClientImpl;
import com.weblog.search.interceptor.FeignInterceptor;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author MaoLin Wang
 * @date 2019/9/2215:37
 */
@FeignClient(value = "weblog-user",fallback = UserClientImpl.class,configuration = FeignInterceptor.class)
public interface UserClient {

    /**
     * 根据id查询用户名
     * @param id
     * @return
     */
    @GetMapping("/user/client/{id}")
    Result findUserNameById(@PathVariable String id);

    /**
     * 根据id查询用户名和头像
     *
     * @param id
     * @return
     */
    @GetMapping("user/client/username/avatar/{id}")
    Result findUserNameAndAvatarById(@PathVariable String id);

}
